<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="../jqgrid/js/jquery-1.7.2.min.js"></script>
<script src="https://jqueryvalidation.org/files/dist/jquery.validate.min.js"></script>
<script src="https://jqueryvalidation.org/files/dist/additional-methods.min.js"></script>
<script type="text/javascript">
	$(function() {
		$("#email").change(function() {
			var email = $("#email").val();
			$.post("checkemail", {email:email}, function(data) {
				if (!data) {
					$("#emailcheck").html("<font color='red'>账号已存在</font>");
				} else {
					$("#emailcheck").html("<font color='green'>账号可注册</font>");
				}
			});
			
			var myreg = /^([\.a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
			
			if (!myreg.test(email)) {
				$("#emailcheck").html("<font>请输入有效的邮箱格式</font>");
			}
		});
	});
</script>

</head>
<body>

	<h1>注册</h1>

	<form action="//register" method="post">
                    租户名字<input name="name" type="text"><br>
                    联系人<input name="enterpriseAdmin.name" type="text"><br>
                    邮箱<input name="enterpriseAdmin.email" type="text" id="email"><span id="emailcheck"></span><br>
                    联系电话<input name="enterpriseAdmin.tel" type="text"><br>
                    密码<input name="enterpriseAdmin.password" type="password"><br>
		<button type="submit">注册</button>

	</form>
</body>
</html>